From: kaf24@firebug.cl.cam.ac.uk Date: Fri, 30 Jun 2006 09:16:12 +0000 (+0100) Subject: [TPM] Adds a script for virtual TPM support. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~15912^2~18 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22man:///%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22man:/?a=commitdiff_plain;h=6303b0e1035251a06ca09224e94722696a5ecade;p=xen.git [TPM] Adds a script for virtual TPM support. It also removes a consistency check from the vtpm-common script file. Signed-off-by: Stefan Berger --- diff --git a/tools/examples/Makefile b/tools/examples/Makefile index c5ccb6c8af..fb93063570 100644 --- a/tools/examples/Makefile +++ b/tools/examples/Makefile @@ -26,7 +26,7 @@ XEN_SCRIPTS += network-route vif-route XEN_SCRIPTS += network-nat vif-nat XEN_SCRIPTS += block XEN_SCRIPTS += block-enbd block-nbd -XEN_SCRIPTS += vtpm vtpm-delete +XEN_SCRIPTS += vtpm vtpm-delete vtpm-addtodb XEN_SCRIPTS += xen-hotplug-cleanup XEN_SCRIPTS += external-device-migrate XEN_SCRIPT_DATA = xen-script-common.sh locking.sh logging.sh diff --git a/tools/examples/vtpm-addtodb b/tools/examples/vtpm-addtodb new file mode 100644 index 0000000000..482b1610d2 --- /dev/null +++ b/tools/examples/vtpm-addtodb @@ -0,0 +1,10 @@ +#!/bin/sh + +# This script must be called with the following parameters to have +# an entry added to the TPM-to-domain associations table in /etc/xen/vtpm.db +# vtpm-addtodb + +dir=$(dirname "$0") +. "$dir/vtpm-common.sh" + +vtpmdb_add_instance $1 $2 diff --git a/tools/examples/vtpm-common.sh b/tools/examples/vtpm-common.sh index 0a6c543002..e4210d1669 100644 --- a/tools/examples/vtpm-common.sh +++ b/tools/examples/vtpm-common.sh @@ -347,16 +347,9 @@ function isLocalAddress() { # 2nd: name of the domain to migrate # 3rd: the migration step to perform function vtpm_migration_step() { - local instance res - instance=$(vtpmdb_find_instance $2) - if [ "$instance" == "" ]; then - echo "Error: Translation of domain name ($2) to instance failed. Check /etc/xen/vtpm.db" - log err "Error during translation of domain name" - else - res=$(isLocalAddress $1) - if [ "$res" == "0" ]; then - vtpm_migrate $1 $2 $3 - fi + local res=$(isLocalAddress $1) + if [ "$res" == "0" ]; then + vtpm_migrate $1 $2 $3 fi } diff --git a/tools/python/xen/util/dictio.py b/tools/python/xen/util/dictio.py deleted file mode 100644 index 4fcebdb88a..0000000000 --- a/tools/python/xen/util/dictio.py +++ /dev/null @@ -1,50 +0,0 @@ -#=========================================================================== -# This library is free software; you can redistribute it and/or -# modify it under the terms of version 2.1 of the GNU Lesser General Public -# License as published by the Free Software Foundation. -# -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -#============================================================================ -# Copyright (C) 2006 International Business Machines Corp. -# Author: Bryan D. Payne -#============================================================================ - - -def dict_read(dictname, filename): - """Loads and returns the dictionary named from - the file. - """ - dict = {} - - # read in the config file - globs = {} - locs = {} - execfile(filename, globs, locs) - - for (k, v) in locs.items(): - if k == dictname: - dict = v - break - - return dict - -def dict_write(dict, dictname, filename): - """Writes to using the name . If the file - contains any other data, it will be overwritten. - """ - prefix = dictname + " = {\n" - suffix = "}\n" - fd = open(filename, "wb") - fd.write(prefix) - for key in dict: - line = " '" + str(key) + "': " + str(dict[key]) + ",\n" - fd.write(line) - fd.write(suffix) - fd.close()